package com.example.iot.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author : Lin
 * @version : [v1.0]
 * @className : MytestController
 * @description : 描述说明该类的功能
 * @createTime : 2023/7/15 16:55
 * @updateUser : Lin
 * @updateTime : 2023/7/15 16:55
 * @updateRemark : 描述说明本次修改内容
 */
@RestController
public class MytestController {


    @PostMapping(value = "/mytest")
    public String mytest(@RequestBody Map<String, Object> data){
        Object t1 = data.get("t1");
        Object t2 = data.get("t2");
        System.out.println(t1);
        System.out.println(t1.getClass());//String 自动装箱
        System.out.println(t2);
        System.out.println(t2.getClass());//Integer 自动装箱

        return data.toString();
    }
    @GetMapping(value = "/mytest1")
    public String mytest1(@RequestParam("t1")String t1){
        System.out.println(t1);

        return t1;
    }
}
